/**
 * 对象存储 OSS - 阿里云
 * https://help.aliyun.com/document_detail/32068.html?spm=a2c4g.11186623.6.1177.29c362bbOOR1I5
 */
const OSS = require('ali-oss');
const UUID = require('node-uuid');

let Client = new OSS($config._aoc.conf);

module.exports = {
    _upload: async (path, local) => {
        try {
            let result = await Client.put(path + UUID.v1(), local)
            return $config._aoc.domain + result.name
        } catch (error) {
            return false
        }
    },
    _download() {
        // let result = await client.get('object-name', 'local-file');
    }
}